<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>index</title>
    <style>
	#pageHeight{
	  height:350px
	}
    #pageHeight1{
	  height:350px
	}
    </style>
</head>
<body>
<div id="container">首页</div>
<div id="pageHeight"></div>
<div id="contentText" style="font-size: 9px;">内容</div>
<div id="pageHeight1"></div>
<div id="ending">末尾</div>
<a href="second.html" id="fileAccess">打开rawfile文件</a>
<img src="icon.png" alt="icon" id="img">
</body>
<script>
    let ele=document.getElementById("img");
    let loadImage;
    ele.onload=function(){
        loadImage="load complete"
    }
    function getUserAgent(){
        return navigator.userAgent
    }
    function test(){
        backToEts.test("backToEts")
    }
    function testRunJavaScript(){
        return "testRunJavaScript"
    }
    function getPageHeight(){
        let height=document.body.scrollHeight
        return height
    }
    function proxy(){
        objName.register("backToEts")
    }
    function registerTest(){
        let str=objName.register();
        console.log(str);
        return str
    }
    function jsAccess(){
        console.log("web111")
    }
    function consoleTest(){
        console.log("console test")
    }
    function alertTest(){
        alert('alert test')
    }
    function confirmTest(){
        confirm("confirm test")
    }
    function getImgResult(){
        return loadImage
    }
    function toPrompt(){
        let result=prompt("age","20");
        console.log("result:"+result)
    }
    function openRawFile(){
        document.getElementById("fileAccess").click()
    }
    function getTitle(){
        return document.title
    }
    function getNavigatorOnLine(){
        let onlineResult = navigator.onLine;
        return onlineResult
    }
    function getFontSize() {
        let fontSize = window.getComputedStyle(document.body, null).getPropertyValue('font-size')
        console.log(fontSize)
        return fontSize
    }

    function getPageFontSize(){
        const start_element = document.getElementById("container");
        let StartEle = start_element.innerText;
        let style = (window.getComputedStyle(document.getElementById("container"), null)).fontSize;
        console.log("StartEle : " + StartEle + style);
        style = style.substring(0,style.length -2)
        console.log(style);
        return +style
    }
    function getPageFontSizes(){
        const start_element = document.getElementById("container");
        let StartEle = start_element.innerText;
        let style = (window.getComputedStyle(document.getElementById("container"), null)).fontSize;
        console.log("StartEle : " + StartEle + style);
        return [StartEle,style]
    }
    getPageFontSize()
    getPageFontSizes()
    function getTestPageFontSize(){
        const middle_element = document.getElementById("contentText");
        let ContentEle = middle_element.innerText;
        let style = (window.getComputedStyle(document.getElementById("contentText"), null)).getPropertyValue('font-size')
        console.log("ContentEle : " + ContentEle + style);
        return [ContentEle,style]
    }
</script>
</html>